#define _CRT_SECURE_NO_WARNINGS
#include<stdio.h>
int main()
{
	char str[10] = { 0 };
	int N = 0;
	scanf("%d", &N);
	int i = 0, k = 0;
	while (N)
	{
		if (k != 0 && k % 3 == 0)
		{
			str[i] = ',';
			i++;
		}
		str[i] = (N % 10) + '0';
		i++; k++;
		N /= 10;
	}
	for (i--; i >= 0; i--)
	{
		printf("%c", str[i]);
	}
	return 0;
}